import Vue from 'vue'
import Router from 'vue-router'
import main from '@/views/main'
import mainpage from '@/views/barItem/mainpage'
import productList from '@/views/barItem/productList'
import shopping from '@/views/barItem/shopping'
import usercenter from '@/views/barItem/usercenter'
import detail from '@/views/details/details'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'main',
      component: main,
      children: [
        {
          path: '/',
          name: '精选',
          component: mainpage
        },
        {
          path: '/productList',
          name: '逛逛',
          component: productList
        },
        {
          path: '/shopping',
          name: '购物车',
          meta: {auth: false},
          component: shopping
        },
        {
          path: '/usercenter',
          name: '我的',
          component: usercenter
        },
      ]
    },
    {
      path: '/detail',
      name: '产品详情',
      component: detail
    },
  ]
})




